<?php
elgg_load_library('elgg:class_tournament');
elgg_load_library('elgg:class_organization');
$tournament = get_entity(get_input('t'));
$org = $tournament->getOrganization();

if($tournament->guid)
{
	if($tournament->delete("Deleted by ".elgg_get_logged_in_user_guid()))
	{
		system_message('Torneo borrado');
		forward($org->getUrl());
	}
	else
	{
		register_error('Torneo no borrado');
		forward(REFERAL);
	}
}
else 
{
	register_error('Torneo no valido');
	forward();
}
